package com.yuanchu.media.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2023-12-19 19:02
 */
@Configuration
public class MybatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //分页拦截器
        PaginationInnerInterceptor pag = new PaginationInnerInterceptor();
        // 溢出总页数后是否进行处理(默认不处理)
        pag.setOverflow(true);
        // 单页分页条数限制(默认无限制)
        pag.setMaxLimit(1000L);
        interceptor.addInnerInterceptor(pag);
        return interceptor;
    }
}
